﻿using System;
using Quail;
using Quail.Sessions;

namespace QuailRepositoryManager
{
    /// <summary>
    /// The QuailRepoTestShell
    /// </summary>
    public class QuailRepoTestShell : TestShell<WebBrowser, WebPage>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="QuailRepoTestShell"/> class.
        /// </summary>
        public QuailRepoTestShell(object owninginstance)
            : base("quailtest", BrowserTypes.FireFox, owninginstance)
        {
        }

        /// <summary>
        /// Gets or sets StartupUrl.
        /// </summary>
        public string StartupUrl
        {
            get;
            set;
        }

        /// <summary>
        /// Gets the default startup URL
        /// </summary>
        /// <returns>the url to startup</returns>
        public override string GetStartupUrl()
        {
            if (StartupUrl != null)
                return StartupUrl;

            return "http://www.google.com";
        }

        /// <summary>
        /// Add the logger factories to the test shell
        /// </summary>
        protected override void AddLoggerFactories()
        {
        }

        /// <summary>
        /// Creates a child shell
        /// </summary>
        /// <returns>a new instance of the test shell</returns>
        public override ITestShell CreateNewTestShell()
        {
            return new QuailRepoTestShell(this);
        }
    }
}
